.navbar {
  display: flex;
  position: fixed;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 60px;
  background: rgba(171, 198, 212, 1);
  padding: 0 0;
  z-index: 998; /* 确保导航栏在最上层 */
}

.navbar-logo {
  margin:0 20px 0 40px;
  color: white;
}

.navbar-logo img {
  height: 60px;
}

.navbar-menu {
  margin-left:30px;
  display: flex;
  gap:40px;
}

.navbar-menu button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.navbar-menu button:hover {
  color:aliceblue;
}

.navbar-search {
  flex: 1; /* 占据剩余空间 */
  display: flex;
  justify-content: center; /* 居中对齐 */
  left: -100px;
  margin-right: 250px; 
}

.navbar-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; 
}

.navbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 保持图片的比例，裁剪多余部分 */
}

/* 菜单图标样式 */
.navbar-menu-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1001; /* 确保图标位于最上层 */
  width: 35px; /* 菜单图标容器大小 */
  height: 35px;
  cursor: pointer;
  margin: 0 35px 0 30px;
}

.navbar-menu-icon {
  width: 100%;
  height: 100%;
  fill: white; /* 图标颜色 */
  transition: transform 0.3s ease;
}

.navbar-menu-icon:hover {
  transform: scale(1.1); /* 鼠标悬停时放大图标 */
}

/* Dropdown menu 样式 */
.navbar-dropdown {
  position: absolute;
  margin-right:8px;
  top: 63px; /* 距离导航栏的距离，确保菜单不被遮挡 */
  right:8px;
  background-color: #ffffff; /* 背景色为白色 */
  border-radius: 8px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* 适当的阴影效果 */
  display: flex;
  flex-direction: column;
  gap: 10px; /* 菜单项之间的间隔 */
  padding: 10px 0;
  z-index: 100;
}

/* 下拉菜单项样式 */
.dropdown-item {
  background: none;
  border: none;
  color: black; 
  font-size: 16px;
  padding: 8px 20px;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background-color: rgba(197, 197, 197, 0.244); /* 鼠标悬停时增加背景色 */
  border-radius: 8px;
  text-decoration: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .navbar-menu {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }

  .navbar-search {
    margin-top: 10px;
  }

  .navbar-user {
    margin-top: 10px;
    align-items: center;
    gap: 10px;
  }

  .user-avatar {
    margin-bottom: 10px;
  }

  .menu-btn {
    margin-top: 10px;
  }

  .navbar-dropdown {
    top: 70px;
    right: 10px;
  }
}
